layout.jsx 411 B

123456789101112131415
  1. import React from "react";
  2. import { notFound } from "next/navigation";
  3. import BranchGuard from "@/components/auth/BranchGuard";
  4. import { isValidBranchParam } from "@/lib/frontend/params";
  5. export default async function BranchLayout({ children, params }) {
  6. const { branch } = await params;
  7. if (!isValidBranchParam(branch)) {
  8. notFound();
  9. }
  10. return <BranchGuard branch={branch}>{children}</BranchGuard>;
  11. }